<template>
  <div>
    <el-menu
      class="menu-tree"
      @open="handleOpen"
      @close="handleClose" router>
      <nav-menus :navMenus="navMenus"></nav-menus>
    </el-menu>
  </div>
</template>
<script type="text/ecmascript-6">
    import navMenus from "./Menu";
    export default {
        components: {
            navMenus
        },
        name:"sideBar",
        data() {
            return {
                activeIndex: '1',
                drawer: false,
                navMenus: [
                    {
                        path:'/',
                        name:'基础样式',
                        children: [
                            {
                                path:'form',
                                name:'二级多选框'
                            },
                            {
                                path:'org',
                                name:'组织结构树'
                            }
                        ]
                    },
                    {
                        path:'/test',
                        name:'本地测试',
                        children: [
                            {
                                path:'/tabs',
                                name:'选项卡'
                            },
                            {
                                path:'/collapse',
                                name:'折叠面板'
                            }
                        ]
                    },
                    {
                        path:'/load',
                        name:'第三方',
                        children: [
                            {
                                path:'/chart',
                                name:'报表'
                            }
                        ]
                    }
                ]
            }
        },
        methods: {
            handleSelect(key, keyPath) {
                console.log(key, keyPath);
            },

            handleOpen(key, keyPath) {
                console.log(key, keyPath);
            },
            handleClose(key, keyPath) {
                console.log(key, keyPath);
            }
        }
    }
</script>
